package JUC并发编程.三大特性.原子性.CAS保证原子性;

public class ThreadLocalTest {

    static ThreadLocal tl1 = new ThreadLocal();
    static ThreadLocal tl2 = new ThreadLocal();

    public static void main(String[] args) {
        tl1.set("aaa");
        tl2.set("bbb");

        Thread thread = new Thread(() -> {
            System.out.println("t1 :" + tl1.get());
            System.out.println("t2 :" + tl2.get());
        });
        thread.start();

        System.out.println("main : " + tl1.get());
        System.out.println("main : " + tl2.get());
    }
}
